(function (window) {
    function GoalDevice(imgGoal, resistance, x, y, voltage) {
        this.voltage = voltage;
        this.initialize(imgGoal, resistance, x, y, voltage);
    }

    GoalDevice.prototype = new BitmapAnimation();

    GoalDevice.prototype.resistance = 0;

    GoalDevice.prototype.BitmapAnimation_initialize = GoalDevice.prototype.initialize;

    GoalDevice.prototype.initialize = function (imgGoal, resistance, x, y, voltage) {
        var localSpriteSheet = new SpriteSheet({
            images: [imgGoal],
            frames: { width: 128, height: 128, regX: 64, regY: 64 },
            animations: {
                turnon: [0, 1],
                idle: [0, 0, "idle", 2]
            }
        });

        this.BitmapAnimation_initialize(localSpriteSheet);
        this.previousBottom = 0.0;
        this.elapsed = 0;
        this.x = x;
        this.y = y;
        this.resistance = resistance;
        this.voltage = voltage;
        this.gotoAndPlay("idle");
    }

    GoalDevice.prototype.tick = function () {
        //this.x++;
        //this.y += this.vY * this.direction;
    }
    window.GoalDevice = GoalDevice;
} (window));